<template>
	<view class="model-brand-component">
		<scroll-view
			scroll-y="true"
			class="brand-scroll-view"
		>
			<view class="model-brand-list">
				<view
					v-for="(v, i) in list"
					:key="i"
					class="model-brand-item"
					:class="{
						active: v.brandId === active
					}"
					@click="change(v)"
				>
					{{ v.brandName }}
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
export default {
	props: {
		list: Array,
		active: String
	},
	methods: {
		change (item) {
			if (this.active === item.brandId) return
			this.$emit('change', item)
		}
	}
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>